#include <iostream>

using namespace std;

int divizori(int);
int fib(int);

int main()
{
    int a[100];
    int n,i,j;
    std::cout<<"n=";
    std::cin>>n;
    for (i=0;i<n;i++)
    {
        std::cout<<"a["<<i<<"]=";
        std::cin>>a[i];
    }
    int k=0;
     for (i=0;i<n;i++)
    {
        int d=divizori(a[i]);
        if ((d==2)&&(fib(a[i])==a[i]))
        {
            //ok sunt indeplinite ambele
            k++;
            std::cout<<a[i]<<" "<<fib(a[i])<<endl;
        }
    }
    if (k==0) std::cout<<"nu sunt elemente care indeplinesc criteriile";

    return 0;
}

int divizori(int x)
{
    int s=0;
    for (int j=1;j<=x;j++)
    {
        if (x%j==0) s=s+1;
    }
    return s;
}

int fib(int x)
{
    int f0=0;
    int f1=1;
    int f;
    while (f0+f1<=x)
    {
        f=f0+f1;
        f0=f1;
        f1=f;
    }
    return f;
}
